package miniproj.models.building;

import javax.xml.bind.annotation.XmlAttribute;

/**
 * This class represent a building
 * 
 * @author Baptiste Viale
 * 
 */
public class Building implements java.io.Serializable {

	private static final long serialVersionUID = 3287116532329756611L;

	@XmlAttribute
	private String name;

	/**
	 * Instantiates a new building.
	 */
	public Building() {
		this.name = "undefined";
	}

	/**
	 * Instantiates a new building.
	 * 
	 * @param name
	 *            the name of the building
	 */
	public Building(String name) {
		this.name = name;
	}

	/**
	 * Return the name of this building.
	 * 
	 * @return the name of the building
	 */
	public String getName() {
		return this.name;
	}

	@Override
	public String toString() {
		return "Building " + this.name;
	}

	@Override
	public boolean equals(Object building) {
		if (!(building instanceof Building))
			return false;

		return (this.name.equals(((Building) building).getName()));
	}
}
